import time
from random import uniform
setGlobalDuration(30)

env = genAdsr()

oscReceive(bus='trig', address='/trig', port=9000)

trigRandom(bus='pit', trigbus='trig', mini=200, maxi=800)

sine(pitch=1, pitchVar='pit', envelope=env, amplitude=.5)

proc = startCsound()

time.sleep(1)

def pit():
    sendOscTrigger(value = 1, address='/trig', port=9000)

ti1 = pattern(.5, pit, [1])
ti1.start()
ti1.play()


